<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<!-- Set render engine for 360 browser -->
	<meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

	<link href="/public/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css" rel="stylesheet">
    <link href="/public/simpleboot/css/simplebootadmin.css" rel="stylesheet">
    <link href="/public/js/artDialog/skins/default.css" rel="stylesheet" />
    <link href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <style>
		.length_3{width: 180px;}
		form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
		.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;}
		.table-list{margin-bottom: 0px;}
	</style>
	<!--[if IE 7]>
	<link rel="stylesheet" href="/public/simpleboot/font-awesome/4.4.0/css/font-awesome-ie7.min.css">
	<![endif]-->
<script type="text/javascript">
//全局变量
var GV = {
    DIMAUB: "/",
    JS_ROOT: "public/js/",
    TOKEN: ""
};
document.domain = "xinhuiwen.com";
</script>
<!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="/public/js/jquery.js"></script>
    <script src="/public/js/wind.js"></script>
    <script src="/public/js/publish.js"></script>

    <script src="/public/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<?php if(APP_DEBUG): ?><style>
		#think_page_trace_open{
			z-index:9999;
		}
	</style><?php endif; ?>
</head>
<?php if($type == '1'){?>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('Admin/AdminUser/index')}">账号列表</a></li>
    </ul>

    <form class="well form-search" id="query_form" method="post" action="<?php echo U('Admin/AdminUser/index');?>">
        姓名：
        <input type="text" name="adminUserName" style="width: 120px;" value="<?php echo ($formParam["adminUserName"]); ?>" placeholder="姓名...">
        <input type="button" name="query_form_btn" id="queryBtn" data-action="<?php echo U('Admin/AdminUser/index');?>"  class="btn btn-primary" value="查询"/>
        <a href='<?php echo U("Admin/AdminUser/adminUserAdd");?>' class="btn btn-primary" >添加</a>
        <a href='<?php echo U("Admin/Special/index");?>' class="btn btn-primary" >专题临时入口</a>
        <br/><br/>
        
    </form>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>序号</th>
                <th>姓名</th>
                <th>账号</th>
                <th>密码</th>
                <th>权限</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <?php $tmp_key = 0;?>
            <?php if(is_array($data)): foreach($data as $key=>$vo): ?><tr>
                    <td><?php echo ($key+1); ?></td>
                    <td><?php echo ($vo["real_name"]); ?></td>
                    <td><?php echo ($vo["username"]); ?></td>
                    <td><?php echo ($vo["admin_pwd"]); ?><a href='<?php echo U("Admin/AdminUser/resetPwdPost",array("admin_id"=>$vo["admin_id"]));?>' class="js-ajax-dialog-btn" style="float:right;"
                           data-msg="确定要重置密码吗？重置后密码为：123456">重置</a></td>
                    <td>
                    <?php
 $role_str = ''; if($vo['role_list']['column_role_count'] > 0) $role_str.= "新闻业务:"; foreach($vo['role_list']['column_role'] as $column_role_key=>$column_role_value){ $role_str.= $column_role_value['name'].','; } $role_str = rtrim($role_str,','); if($vo['role_list']['sys_menu_role_count'] > 0) $role_str.= "</br>其他业务:"; foreach($vo['role_list']['sys_menu_role'] as $sys_menu_role_key=>$sys_menu_role_value){ $role_str.= $sys_menu_role_value['name'].','; } $role_str = rtrim($role_str,','); if($vo['role_list']['company_info']){ $role_str.= "</br>所属公司:"; $role_str.= $vo['role_list']['company_info'].','; } $role_str = rtrim($role_str,','); echo $role_str; ?>
                    
                    </td>
                    <td>
                        <a href='javascript:void(0);' onclick="edit_role(<?php echo ($vo['admin_id']); ?>)" >权限设置</a>
                        <a href='<?php echo U("Admin/AdminUser/del",array("adminUserId"=>$vo["admin_id"]));?>' class="js-ajax-dialog-btn"
                           data-msg="确定要删除此业务管理员吗？">删除</a>
                    </td>
                </tr><?php endforeach; endif; ?>
            </tbody>
        </table>
    </form>
    <div class="pagination"><?php echo ($page); ?></div>
</div>
<script src="/public/js/common.js"></script>
<script src="/public/js/layer/layer.js"></script>
<script src="/public/js/2.1.4jquery.js"></script>
<script>
    $(document).ready(function () {
        $('input[name="query_form_btn"]').click(function () {
            $('#query_form').attr('action', $(this).attr('data-action'));
            $('#query_form').submit();
        });
    });
    
 function edit_role(admin_id){
	  layer.open({
  	    type: 2,
  	    //skin: 'layui-layer-lan',
  	    title: '修改管理员权限',
  	    fix: false,
  	    shadeClose: true,
  	    maxmin: true,
  	    area: ['1000px', '500px'],
  	    content: "<?php echo U('Admin/AdminUser/editRole')?>"+'&admin_id='+admin_id,
  	    end: function(){
  	    	location.reload();
  	    }
  	  });
 }
</script>
</body>




<!-- 业务管理员页面 -->




<?php
 }else{ ?>
<body>
<div class="wrap js-check-wrap">
    <form class="well form-search" id="query_form" method="post" action="<?php echo U('Admin/AdminUser/index');?>">
        姓名：<?php echo ($data['real_name']); ?></br>
        账号：<?php echo ($data['username']); ?></br>
        密码：<?php echo ($data['admin_pwd']); ?>&nbsp;&nbsp;&nbsp;<a href='jsvascript:;' onclick="reset_pwd(<?php echo ($data["admin_id"]); ?>)" >重置密码</a></br>
    </form>
    
</div>
<script src="/public/js/common.js"></script>
<script src="/public/js/layer/layer.js"></script>
<script>
 function reset_pwd(admin_id){
	  layer.open({
  	    type: 2,
  	    //skin: 'layui-layer-lan',
  	    title: '修改管理员权限',
  	    fix: false,
  	    shadeClose: true,
  	    maxmin: true,
  	    area: ['1000px', '500px'],
  	    content: "<?php echo U('Admin/AdminUser/resetPwd')?>"+'&admin_id='+admin_id,
  	    end: function(){
  	    	location.reload();
  	    }
  	  });
 }
</script>
</body>
<?php
 } ?>
</html>